package com.ruoyi.project.AnswerQuestion.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.project.AnswerQuestion.domain.TbQuestionAnswer;
import com.ruoyi.project.AnswerQuestion.mapper.TbQuestionAnswerMapper;
import com.ruoyi.project.AnswerQuestion.service.ITbQuestionAnswerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 【请填写功能名称】Service业务层处理
 * 
 * @author lvyongwei
 * @date 2020-11-26
 */
@Service
public class TbQuestionAnswerServiceImpl implements ITbQuestionAnswerService
{
    @Autowired
    private TbQuestionAnswerMapper tbQuestionAnswerMapper;

    /**
     * 查询【请填写功能名称】
     * 
     * @param questionAnswerId 【请填写功能名称】ID
     * @return 【请填写功能名称】
     */
    @Override
    public TbQuestionAnswer selectTbQuestionAnswerById(Long questionAnswerId)
    {
        return tbQuestionAnswerMapper.selectTbQuestionAnswerById(questionAnswerId);
    }

    /**
     * 查询【请填写功能名称】列表
     * 
     * @param tbQuestionAnswer 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<TbQuestionAnswer> selectTbQuestionAnswerList(TbQuestionAnswer tbQuestionAnswer)
    {
        return tbQuestionAnswerMapper.selectTbQuestionAnswerList(tbQuestionAnswer);
    }

    /**
     * 新增【请填写功能名称】
     * 
     * @param tbQuestionAnswer 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertTbQuestionAnswer(TbQuestionAnswer tbQuestionAnswer)
    {
        tbQuestionAnswer.setCreateTime(DateUtils.getNowDate());
        return tbQuestionAnswerMapper.insertTbQuestionAnswer(tbQuestionAnswer);
    }

    /**
     * 修改【请填写功能名称】
     * 
     * @param tbQuestionAnswer 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateTbQuestionAnswer(TbQuestionAnswer tbQuestionAnswer)
    {
        tbQuestionAnswer.setUpdateTime(DateUtils.getNowDate());
        return tbQuestionAnswerMapper.updateTbQuestionAnswer(tbQuestionAnswer);
    }

    /**
     * 删除【请填写功能名称】对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTbQuestionAnswerByIds(String ids)
    {
        return tbQuestionAnswerMapper.deleteTbQuestionAnswerByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除【请填写功能名称】信息
     * 
     * @param questionAnswerId 【请填写功能名称】ID
     * @return 结果
     */
    @Override
    public int deleteTbQuestionAnswerById(Long questionAnswerId)
    {
        return tbQuestionAnswerMapper.deleteTbQuestionAnswerById(questionAnswerId);
    }
}
